<!--用电监测   回路列表页面-->
<!doctype html>
<html>
<head>
	<meta charset="UTF-8">
	<title></title>
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<link rel="stylesheet" href="../css/mui.min.css"  />
	<link rel="stylesheet" href="../iconfont/iconfont.css" />
</head>
<style type="text/css">
	.lineHeight{
		line-height: 42px;
		font-size: 16px;
	}
	#search{
		width:80%;
		height:50px;
		margin:auto;
		line-height: 50px;
	}
	 .mui-search .mui-placeholder{
	 	line-height: 50px;
	 }
	 
	 .iconfont {
		  font-family: "iconfont" !important;
		  font-size: 33px;
		  font-style: normal;
		  -webkit-font-smoothing: antialiased;
		  -moz-osx-font-smoothing: grayscale;
		  color: #CC1111;
	 }
	 
	 .mui-icon-back:before, .mui-icon-left-nav:before{
	 	 color: #000000;
	 }
	 
</style>
<body>
	<div class="mui-content">
	    <div class=" mui-input-row mui-search" id="search">
	    	<input type="search" class="mui-input-clear" placeholder="请输入">
	  	</div>
	    <ul class="mui-table-view" id="monitoringList">
	    	
        
	    </ul>
	</div>
		
</body>
<script type="text/javascript" src="../js/mui.min.js"></script>
<script type="text/javascript" src="../js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="../js/template-web.js"></script>
<script type="text/javascript" src="../js/ZNative.js"></script>
<script type="text/javascript" src="../js/common.js"></script>
<script id="monitoringList_script" type="text/html">
{{each rows as value index}} 
		<li class="mui-table-view-cell mui-media">
			<!--模板那里遍历后就是数组里面的值了。打点取值就好value.dclName-->
            <a href="#" dclId="{{value.dclId}}" dclname="{{value.dclName}}">
                <p class="iconfont  mui-media-object mui-pull-left">&#xea7a;</p>
                	<!--左图右文就这样写-->
                <div class="lineHeight">
                   	 <span>{{value.dclName}}</span>
                   	 <!--<span class=" mui-pull-right ">在线<span class="mui-icon mui-icon-arrowright"></span></span>-->
                </div>
            </a>
        </li>
{{/each}} 
</script>
<script type="text/javascript">


	WebOS.OnReadly(function(args){
	
		var token = WebOS.getItem('token');
		//console.log(token);
		
		var obj = JSON.parse(args);
		//console.log(args);
		var getDclLineList = 'appDclElcMonitor/getDclLineList';
		
		
		var stationId = obj.stationId;
		var _type =  obj.type;

		mui.ajax(getUrl + getDclLineList,{
				data: {
						sysId:sysId,
						sid:stationId,
						token:token
				},
				dataType: 'json', //服务器返回json格式数据
				type: 'post', //HTTP请求类型
				timeout: 10000, //超时时间设置为10秒；
				headers: {
					'Content-Type': 'application/x-www-form-urlencoded'
				},
				success:function(json){
					if(json.tokenFlag == false) {
						mui.alert(json.msg);
						//		记得每个页面都要有这个判断						
					} else {
						var dclId;
						var len = json.rows.length;
						for(var i = 0; i <len; i++){
							var rowsItemData = json.rows[i];
							if(rowsItemData!=null){
								dclId = json.rows[i].dclId;
								
	                   		}
						}
	
						var html = template("monitoringList_script",json);
						mui("#monitoringList")[0].innerHTML = html;
						mui("#monitoringList").on('tap','a',function(){
						
							var _dclId = this.getAttribute("dclId");
							var _dclname = this.getAttribute("dclname");
							
							if(_type = "1"){
							
								WebOS.openWebView({
									title:_dclname,
									url:"monitoring.html",
									args:{stationId:stationId,dclId : _dclId}
								});
								
							}else {
							
								WebOS.openWebView({
									title:_dclname,
									url:"xuliang.html",
									args:{stationId:stationId,dclId : _dclId}
								});
							
							
							
							}
						
								
						});	
					}
					
				},
				error: function(e) {
	
				}
			});
			

		
			
	});



	/*
	WebOS.openWebView({
			title:"webView",
			url:"xuliang.html",
			args:""
	});
	WebOS.openWebViewWithCfg({
			title:"webView",
			url:"xuliang.html",
			args:"",
			webcfg:{used_titlebar:'no',used_pressbar:'yes'}
	});

	WebOS.toast('xuliang.html');


	WebOS.getDate({date:'2019-06-18'},function(data){

		console.log('WebOS.getDate:'+data);
		WebOS.toast(data);

	});

	WebOS.openScene('10003');

								*/
	

	


</script>
</html>